﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Xyz.Web.Reservation.Models.CardPaymentModel>" %>

<%@ Import Namespace="Xyz.Web.Reservation.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    CardPayment
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Credit Card Payment
    </h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <div>
            <h5>Card Information</h5>
        </div>
        <table>
            <tr>
                <td style="width: 120px;">
                    <%: Html.LabelFor(model => model.PaymentMethodCode) %>
                </td>
                <td>
                    <%--<%= Html.DropDownList("CategoryId", ViewData["PaymentMethods"] as SelectList)%> --%>
                    <% foreach (PaymentMethodModel paymentMethod in (List<PaymentMethodModel>)ViewData["PaymentMethods"])
                       {%>
                    <%: Html.RadioButton("PaymentMethodCode", paymentMethod.PaymentMethodCode, false)%>
                    <%: paymentMethod.PaymentMethodDescription%>
                    <% } %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.PaymentMethodCode)%>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.NameOnCard) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.NameOnCard) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.NameOnCard) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.CardTypeCode) %>
                </td>
                <td>
                    <% foreach (CardTypeModel cardType in (List<CardTypeModel>)ViewData["CardTypes"])
                       {%>
                    <%: Html.RadioButton("CardTypeCode", cardType.CardTypeCode, false)%>
                    <%: cardType.CardTypeDescription%>
                    <% } %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.CardTypeCode)%>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.CardNo) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.CardNo) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.CardNo) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.CardExpiryDate) %>
                </td>
                <td>
                    <%: Html.EditorFor(model => model.CardExpiryDate)%>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.CardExpiryDate) %>
                </td>
            </tr>
        </table>
        <br />
        <div>
            <h5>Billing Address</h5>
        </div>
        <table>
            <tr>
                <td style="width: 120px;">
                    <%: Html.LabelFor(model => model.AddressLine1) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.AddressLine1) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.AddressLine1) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.AddressLine2) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.AddressLine2) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.AddressLine2) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.AddressLine3) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.AddressLine3) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.AddressLine3) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.Country) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.Country) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.Country) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.City) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.City) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.City) %>
                </td>
            </tr>
            <tr>
                <td>
                    <%: Html.LabelFor(model => model.PostalCode) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(model => model.PostalCode) %>
                </td>
                <td>
                    <%: Html.ValidationMessageFor(model => model.PostalCode) %>
                </td>
            </tr>
        </table>
        <br />
    </fieldset>
    <input type="submit" value="  Submit  " class="yellow_button" />
    <br />
    <br />
    <% } %>
    <%--    <script type="text/javascript">
        $(document).ready(function () {
            $('#CardExpiryDate').datepicker();
            $('#CardExpiryDate').datepicker('setDate', new Date());
        });
    </script>--%>
</asp:Content>
